package cn.com.weather.nf.vo;

import java.util.List;

/**
 * Created by chengchao on 2016/10/26.
 */
public class ListResult {

    private Integer total;
    private List<?> rows;
    private Integer current;
    private Integer pageSize;

    public static class Builder {
        private Integer total;
        private List<?> rows;
        private Integer current;
        private Integer pageSize;

        public Builder setTotal(Integer total) {
            this.total = total;
            return this;
        }

        public Builder setRows(List<?> rows) {
            this.rows = rows;
            return this;
        }

        public Builder setCurrent(Integer current) {
            this.current = current;
            return this;
        }

        public Builder setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
            return this;
        }


        public ListResult build() {
            return new ListResult(this);
        }
    }

    private ListResult(Builder builder) {
        this.total = builder.total;
        this.current = builder.current;
        this.pageSize = builder.pageSize;
        this.rows = builder.rows;

    }


    public ListResult(Integer total, List<?> rows) {
        this.total = total;
        this.rows = rows;
    }

    public Integer getTotal() {
        return total;
    }


    public List<?> getRows() {
        return rows;
    }


    public Integer getCurrent() {
        return current;
    }

    public Integer getPageSize() {
        return pageSize;
    }


    @Override
    public String toString() {
        return "ListResult [total=" + total + ", rows=" + rows + ", current=" + current + ", pageSize=" + pageSize
                + "]";
    }


}
